package com.bawei.mall.product.controller;

import com.bawei.common.core.domain.R;
import com.bawei.mall.product.service.MallProductHotwordInfoService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author：liurui
 * @Package：com.bawei.mall.product.controller
 * @Project：mall_cloud
 * @name：MallProductHotwordInfoController
 */
@RestController
@RequestMapping("/hotword")
@Log4j2
public class MallProductHotwordInfoController {
    @Autowired
    private MallProductHotwordInfoService service;

    /**
     * 查询
     */
    @GetMapping("/find")
    public R<List<String>> find(){
        List<String> list=service.find();
        return R.ok(list);
    }

    /**
     * 添加
     */
    @PostMapping("/add")
    public R add(@RequestParam String name){
        service.add(name);
        return R.ok();
    }

    /**
     * 修改->增加次数
     */
    @PostMapping("/update")
    public R update(@RequestParam Integer id){
        service.update(id);
        return R.ok();
    }
}
